package com.zhuiyun.educations.api.User.service;

import com.zhuiyun.educations.api.User.entity.User;
import com.zhuiyun.educations.common.response.CommonResult;
import org.springframework.web.multipart.MultipartFile;

public interface UserService {
    /**
     * 通过登录名登录
     *
     * @param loginName
     * @return
     */
    User getUserByLoginName(String loginName);


    /**
     * @return
     * @Author yangze
     * @Description TODO 根据邮箱 获取验证码注册
     * @Date 2023/6/16 14:57
     * @Return
     */
    Object sendEmail(String email);

    Object getUserByUserName(String userName);

    Object getUserByEmail(String email);


    /**
     * @Author yangze
     * @Description  TODO 注册
     * @Date 2023/6/19 19:55
     * @Return
     * @param
     */
    Object register(User user,String code);
    /**
     * @Author cjl
     * @Description 根据用户id查询信息(除了密码)
     * @Date 2023/6/20 19:19
     * @Return com.zhuiyun.educations.common.response.CommonResult
     * @param id
     */
    CommonResult selectUserbyId(Integer id);
    /**
     * @Author cjl
     * @Description  根据id修改用户信息(除了密码)
     * @Date 2023/6/21 17:57
     * @Return com.zhuiyun.educations.common.response.CommonResult
     * @param user
     */
    CommonResult updateUserByLoginNameById(User user);
    /**
     * @Author cjl
     * @Description 根据电话查询是否绑定了手机号
     * @Date 2023/6/23 9:02
     * @Return com.zhuiyun.educations.common.response.CommonResult
     * @param phone
     */
    CommonResult selectUserByPhone(String phone);
    /**
     * @Author cjl
     * @Description 根据邮箱查询是否重复的邮箱
     * @Date 2023/6/23 14:11
     * @Return com.zhuiyun.educations.common.response.CommonResult
     * @param email
     */
    CommonResult selectUserByEmail(String email);
    /**
     * @Author cjl
     * @Description 根据登录名查询是否重复的名称
     * @Date 2023/6/23 14:11
     * @Return com.zhuiyun.educations.common.response.CommonResult
     * @param loginName
     */
    CommonResult selectUserByLoginName(String loginName);


    CommonResult sendVerificationCode(String phone);

    CommonResult verifyPhone(String phone, String verificationCode);

    CommonResult findPassword(String email, String code, String password);


    CommonResult updateUserById(MultipartFile imageFile, User user);

}
